<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>转账汇款</title>

    <script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>


    <style type="text/css">
        body {
            background-color:#00b38a;
            text-align:center;
        }

        .lp-login {
            position:absolute;
            width:500px;
            height:300px;
            top:50%;
            left:50%;
            margin-top:-250px;
            margin-left:-250px;
            background: #fff;
            border-radius: 4px;
            box-shadow: 0 0 10px #12a591;
            padding: 57px 50px 35px;
            box-sizing: border-box
        }


        .lp-login .submitBtn {
            display:block;
            text-decoration:none;
            height: 48px;
            width: 150px;
            line-height: 48px;
            font-size: 16px;
            color: #fff;
            text-align: center;
            background-image: -webkit-gradient(linear, left top, right top, from(#09cb9d), to(#02b389));
            background-image: linear-gradient(90deg, #09cb9d, #02b389);
            border-radius: 3px
        }


        input[type='text'] {
            height:30px;
            width:250px;
        }

        span {
            font-style: normal;
            font-variant-ligatures: normal;
            font-variant-caps: normal;
            font-variant-numeric: normal;
            font-variant-east-asian: normal;
            font-weight: normal;
            font-stretch: normal;
            font-size: 14px;
            line-height: 22px;
            font-family: "Hiragino Sans GB", "Microsoft Yahei", SimSun, Arial, "Helvetica Neue", Helvetica;
        }

    </style>
    <script type="text/javascript">
        $.ajax({    //使用JQuery内置的Ajax方法
            type : "get",        //post请求方式
            async : true,        //异步请求（同步请求将会锁住浏览器，用户其他操作必须等待请求完成才可以执行）
            url : "./resume/listAll",    //请求发送到ShowInfoIndexServlet处
            dataType : "json",        //返回数据形式为json
            success : function(ret) {
                //请求成功时执行该函数内容，result即为服务器返回的json对象
                if (ret != null && ret.code =="200") {
                    var result=ret.data;
                    //动态生成表格
                    var tableInfos = document.getElementById('resumeTable');
                    var code = '<TABLE style="width:900px;height:350px;" border="1">';
                    code += '<TR><TH>id</TH><TH>地址</TH><TH>名称</TH><TH>电话</TH><TH>操作</TH></TR>';
                    for (var i = 0; i < result.length; i++) {
                        var id=result[i].id;
                        var delHref='<a href="./resume/deleteResume?id='+id+'">删除</a>';
                        code += '<TR><TD>' + result[i].id + '</TD><TD>' + result[i].address + '</TD><TD>'+ result[i].name + '</TD><TD>'+ result[i].phone +
                            '</TD><TD>'+ delHref +
                            '</TD></TR>';
                    }
                    tableInfos.innerHTML = code + '</TABLE>';
                }

            },
            error:function(ret){
                console.log(ret);
                alert(ret);
                window.location.href="./login.html"
            }

        })
    </script>
</head>
<body>

<a href="./add.html">添加</a>
<div style="width:900px;height:400px;" id="resumeTable"></div>

</body>
</html>
